:root {
    /* dark color for background*/
    /* default color */
    --bg-color1: rgb(40, 44, 52);
    /* for most panel, context, header, etc */
    --bg-color2: rgb(33, 37, 43);
    /* for toc and table edit panel */
    --bg-color3: rgba(16, 17, 20, 0.5);
    /* for tips */
    --bg-color4: black;
    /* for blockquote, codeblock, input, etc */
    --bg-color5: rgb(29, 31, 35);
    /* light color for text and icon*/
    /* default color */
    --text-color1: rgb(170, 178, 180);
    /* for text on panel */
    --text-color2: rgb(220, 220, 220);
    /* for checkbox and radio */
    --text-color3: hsl(192, 6%, 40%);
    /* for tips */
    --text-color4: white;
    /* for focus mode */
    --text-color5: rgba(170, 178, 180, 0.5);
    /* link color */
    --link-color: rgb(197, 202, 210);
    /* table color */
    --table-border-color: rgb(100, 104, 116);
    --table-thead-color: rgb(31, 35, 40);
    --table-bg-color: rgb(40, 45, 52);
    --table-bg-darker-color: rgb(35, 40, 46);
    /* hover color */
    /* default hover background color */
    --hover-bg-color1: rgb(62, 66, 73);
    /* for input item */
    --hover-bg-color2: hsl(220, 9%, 14%);
    /* for button on toc and table edit panel */
    --hover-bg-color3: rgba(62, 66, 73, 0.8);
    /* default hover text color */
    --hover-text-color: white;
    /* active color */
    --active-color: var(--hover-bg-color1);
    /* input color */
    --input-color: rgb(29, 31, 35);
    /* menu divider color */
    --menu-divider-color: rgb(95, 97, 101);
    /* scrollbar color */
    --scrollbar-thumb-color: var(--menu-divider-color);
    --scrollbar-track-color: rgba(95, 97, 101, 0.3);
    /* theme select color */
    --theme-select-color: rgba(255, 255, 255, 0.5);
    --button-color: rgb(62, 66, 73);
    --select-color: rgb(33, 37, 43);
    /* focus color */
    --focus-color: rgba(100, 100, 100, .8);
    --focus-ring-color: var(--focus-color);
    /* codeblock color */
    --code-red-color: rgb(221, 110, 115);
    --code-yellow-color: rgb(218, 192, 123);
    --code-cyan-color: rgb(86, 182, 194);
    --code-blue-color: rgb(94, 174, 237);
    --code-purple-color: rgb(195, 115, 215);
    --code-orange-color: rgb(221, 153, 103);
    --code-grey-color: rgb(127, 132, 142);
    --code-green-color: rgb(152, 195, 123);
    --code-select-bg-color: rgb(64, 72, 89);
    --code-cursor-color: rgb(82, 139, 255);
    /* implicit selecttion text bg color */
    --select-text-bg-color: rgb(150, 156, 170);
    /* implicit button color */
    --primary-color: var(--button-color);
    --primary-btn-border-color: transparent;
    --primary-btn-text-color: var(--text-color2);
    /* implicit sidebar color */
    --side-bar-bg-color: var(--bg-color2);
    --control-text-color: var(--text-color2);
    /* implicit text color */
    --text-color: var(--text-color1);
    /* implicit background color for setting menu */
    --bg-color: var(--bg-color1);
    /* implicit hover color */
    --item-hover-bg-color: var(--hover-bg-color1);
    --item-hover-text-color: var(--hover-text-color);
    /* implicit active color */
    --active-file-bg-color: var(--hover-bg-color);
    /* implicit mathjax edit panel background color */
    --rawblock-edit-panel-bd: var(--bg-color5);
    /* implicit focus mode color */
    --blur-text-color: var(--text-color5);
    /* implicit search result select color */
    --search-select-bg-color: var(--select-text-bg-color);
    --search-select-bg-color: rgb(56, 71, 95);

    --control-text-hover-color: var(--hover-text-color);
    /* implicit active file color in sidebar file menu treeview */
    --active-file-text-color: var(--hover-text-color);
    --active-file-border-color: var(--hover-text-color);

    --node-border: var(--menu-divider-color);
    --node-fill: var(--bg-color2);
}

/* font */
@font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: normal;
    src: local('Open Sans Regular'), url('./onedark/400.woff') format('woff');
}

@font-face {
    font-family: 'Open Sans';
    font-style: italic;
    font-weight: normal;
    src: local('Open Sans Italic'), url('./onedark/400i.woff') format('woff');
}

@font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: bold;
    src: local('Open Sans Bold'), url('./onedark/700.woff') format('woff');
}

@font-face {
    font-family: 'Open Sans';
    font-style: italic;
    font-weight: bold;
    src: local('Open Sans Bold Italic'), url('./onedark/700i.woff') format('woff');
}

/* basic style */
html {
    font-size: 16px;
}

body {
    font-family: "Open Sans", "Clear Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: var(--text-color1);
    background: var(--bg-color1);
    line-height: 1.6;
}

/* text selection background color */
.in-text-selection {
    background-color: rgb(64, 72, 89);
}

/* link */
#write a:not([role=menuitem]) {
    color: var(--link-color) !important;
}

#write a:not([role=menuitem]):hover {
    color: var(--hover-text-color) !important;
}

/* h1-h6 */
#write h1,
#write h2,
#write h3,
#write h4,
#write h5,
#write h6 {
    margin-top: 0.5em;
    margin-bottom: 0em;
    line-height: 1em;
}

#write h1 {
    font-size: 2.5em;
    padding-bottom: .5em;
    border-bottom: 5px double var(--text-color1);
}

#write h1:before {
    content: '\00A7  ';
}

#write h2 {
    font-size: 2em;
    padding-bottom: .5em;
    border-bottom: 3px double var(--text-color1);
}

#write h2:before {
    content: '\00A7  '
}

#write h3 {
    font-size: 1.75em;
    padding-bottom: .5em;
    border-bottom: 1px solid var(--text-color1);
}

#write h4 {
    font-size: 1.55em;
}

#write h5 {
    font-size: 1.35em;
}

#write h6 {
    font-size: 1.2em;
}

/* horizontal divider */
hr {
    height: 2px;
    background-color: var(--text-color1);
    border: 0px;
}

/* list */
ul,
ol {
    padding-left: 30px;
}

/* blockquote */
blockquote {
    border-left: 4px solid var(--text-color1);
    padding: 4px 15px;
    color: var(--text-color1);
    background-color: var(--bg-color5);
    box-shadow: 0px 0px 10px rgba(0, 0, 0, .2);
}

blockquote blockquote {
    padding-right: 0em;
}

/* table */
.md-table-fig,
.md-table-fig:active {
    box-shadow: 0px 0px 10px rgba(0, 0, 0, .2);
}

.md-table thead tr {
    background-color: var(--table-thead-color);
}

.md-table tr th {
    font-weight: bold;
    border-left: 1px solid var(--table-border-color);
    border-right: 1px solid var(--table-border-color);
    text-align: left;
    margin: 0;
    padding: 6px 13px;
}

.md-table tbody tr {
    border-top: 1px solid var(--table-border-color);
    margin: 0;
    padding: 0;
}

.md-table tbody tr:nth-child(2n) {
    background-color: var(--table-bg-darker-color);
}

.md-table tbody tr:nth-child(2n+1) {
    background-color: var(--table-bg-color);
}

.md-table tr td {
    border-left: 1px solid var(--table-border-color);
    border-right: 1px solid var(--table-border-color);
    text-align: left;
    margin: 0;
    padding: 6px 13px;
}

.md-table tr th:first-child,
.md-table tr td:first-child {
    border-left-width: 0px;
}

.md-table tr th:last-child,
.md-table tr td:last-child {
    border-right-width: 0px;
}

/* table edit panel */
.ty-table-edit {
    background-color: var(--bg-color3);
    border: 0px;
    border-radius: 6px;
    padding-top: 2px;
    padding-bottom: 2px;
    padding-left: 6px;
    padding-right: 6px;
    margin-top: -29px !important;
}

/* button on table edit panel */
.ty-table-edit button {
    background-color: transparent;
    color: var(--text-color2);
    border: 0px;
    margin-left: 0px !important;
}

/* button hover on table edit panel */
.ty-table-edit button:hover {
    background-color: var(--hover-bg-color3);
    color: var(--hover-text-color);
}

/* adjusting table panel */
.popover {
    background-color: var(--bg-color2);
    box-shadow: 2px 2px 10px rgba(0, 0, 0, .5);
}

/* arrow of adjusting table panel */
.popover.bottom>.arrow:after {
    border-bottom-color: var(--bg-color2);
}

/* divider in adjust table panel */
.md-grid-board-wrap .popover-title {
    border-top-color: var(--menu-divider-color);
}

/* grid size */
.md-grid-board a {
    width: 15px;
    height: 15px;
}

/* existing thread grid */
.md-grid-board tr[row='1'] .md-grid-ext {
    background-color: rgb(60, 60, 60);
}

/* not existing thread grid */
.md-grid-board tr[row='1'] {
    background-color: rgb(220, 220, 220);
}

/* existing grid */
.md-grid-board .md-grid-ext {
    background-color: rgb(120, 120, 120);
}

/* selected thread grid */
.md-grid-board tr[row='1'] a.md-active,
.md-grid-board tr[row='1'] a:hover {
    background-color: rgb(60, 60, 60);
}

/* selected grid */
.md-grid-board a.md-active,
.md-grid-board a:hover {
    border-color: var(--menu-divider-color);
    background-color: rgb(120, 120, 120);
}

/* task */
.md-task-list-item>input {
    margin-left: -1.3em;
}

/* footnote */
sup.md-footnote {
    color: var(--text-color1);
    background-color: var(--bg-color2);
    box-shadow: 0px 0px 10px rgba(0, 0, 0, .2);
}

/* mathjax */
/* .mathjax-block>.code-tooltip {
    bottom: .375rem;
}
.md-mathjax-midline {
    background: #fafafa;
} */
.md-inline-math script {
    color: var(--text-color1);
}

.md-rawblock>.md-rawblock-container {
    transition: 0.5s;
}

.md-rawblock>.md-rawblock-tooltip {
    transition: 0.5s;
    display: block;
    visibility: hidden;
    opacity: 0;
}

.md-rawblock:hover>.md-rawblock-tooltip {
    transition: 0.5s;
    visibility: visible;
    opacity: 1;
    animation: none;
}

/* meta information of image */
.md-image>.md-meta {
    border: 0px;
    padding: 2px 0px 0px 4px;
    font-size: 0.9em;
    color: var(--text-color1);
}

/* input */
input {
    background-color: var(--input-color) !important;
    border: 0px !important;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, .2);
}

/* input hover */
/* input:hover {
    background-color: var(--hover-bg-color2) !important;
} */
/* checkbox */
input[type=checkbox]:before {
    content: "";
    display: inline-block;
    width: 1.1rem;
    height: 1.1rem;
    vertical-align: middle;
    text-align: center;
    border: 0px;
    border-radius: 3px;
    background-color: var(--input-color);
    margin-top: -0.5rem;
    margin-left: -0.1rem;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, .2);
}

/* checkbox hover */
input[type=checkbox]:not([disabled]):not(:checked):hover:before {
    content: '\2713';
    font-size: 0.9rem;
    line-height: 1.2rem;
    color: var(--text-color3);
}

/* checkbox checked*/
input[type=checkbox]:checked:before {
    content: '\2713';
    font-size: 0.9rem;
    line-height: 1.2rem;
    color: var(--text-color2);
}

/* checkbox checked hover*/
input[type=checkbox]:checked:hover:before {
    content: '\2713';
    font-size: 0.9rem;
    line-height: 1.2rem;
    color: var(--hover-text-color);
}

/* radio */
input[type=radio]:before {
    content: "";
    display: inline-block;
    width: 1.1rem;
    height: 1.1rem;
    vertical-align: middle;
    text-align: center;
    border: 0px;
    border-radius: 0.55rem;
    background-color: var(--input-color);
    margin-top: -0.4rem;
    margin-left: -0.1rem;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, .2);
}

/* radio hover */
input[type=radio]:not([disabled]):not(:checked):hover:before {
    content: '\25CF';
    font-size: 1rem;
    line-height: 1rem;
    color: var(--text-color3);
}

/* radio checked */
input[type=radio]:checked:before {
    content: '\25CF';
    font-size: 1rem;
    line-height: 1rem;
    color: var(--text-color2);
}

/* radio checked hover*/
input[type=radio]:checked:before {
    content: '\25CF';
    font-size: 1rem;
    line-height: 1rem;
    color: var(--hover-text-color);
}

/* default focus style */
:focus {
    outline-color: var(--focus-color);
}

/* exit source view button */
.typora-sourceview-on #toggle-sourceview-btn {
    background-color: var(--bg-color2)
}

.typora-sourceview-on #toggle-sourceview-btn:hover {
    background-color: var(--hover-bg-color1)
}

/* shadow for image item*/
.md-image img {
    box-shadow: 0px 0px 10px rgba(0, 0, 0, .2);
}

/* toc */
.md-toc {
    background-color: var(--bg-color3);
    border-radius: 6px;
    padding: 0px 0px 0px 0px;
    margin: 0px 0px 0px 0px;
    border: 0px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, .2);
}

/* toc content */
.md-toc-content {
    padding-top: 5px;
    padding-bottom: 8px;
    margin-top: 15px;
    margin-bottom: 0px;
}

/* remove outline when toc is selected */
.md-toc:focus .md-toc-content {
    border: 0px;
    margin: 0px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, .2);
}

/* toc item */
.md-toc-item {
    margin: 2px;
}

/* toc edit panel */
#write div.md-toc-tooltip {
    border: 0px;
    padding-left: 10px;
    padding-right: 10px;
    background-color: var(--bg-color3);
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    opacity: 0;
    visibility: hidden;
    display: block !important;
    transition: .3s;
}

#write .md-toc:focus div.md-toc-tooltip {
    visibility: visible;
    opacity: 1;
}

#write .md-toc:focus {
    border-top-left-radius: 0px;
    border-top-right-radius: 0px;
}

/* toc delete button */
.md-delete-toc {
    background-color: transparent;
}

/* html block */
.md-htmlblock:hover .md-htmlblock-container {
    box-shadow: 0px 0px 10px rgba(0, 0, 0, .2);
    border-radius: 6px;
    border-top-right-radius: 0px;
}

/* search panel */
#md-searchpanel {
    background-color: var(--bg-color2);
    color: var(--text-color2);
    box-shadow: 0px 2px 10px rgba(0, 0, 0, .5);
}

/* ignore case button and find whole word button */
.searchpanel-search-option-btn {
    border: 0px;
}

/* button on search panel */
#md-searchpanel .btn:hover {
    color: var(--hover-text-color);
    background-color: var(--hover-bg-color1) !important;
}

/* remove shadow around input in search panel*/
#md-searchpanel input {
    box-shadow: none;
}

/* search option button hover */
.searchpanel-search-option-btn:not(.active):hover {
    color: var(--hover-text-color);
    background-color: var(--hover-bg-color1);
}

/* close button in search panel */
#md-searchpanel .input-group-addon.close-btn {
    padding-left: 16px;
    padding-right: 16px;
}

/* replaceall button */
.ty-replace-panel-row #search-panel-replaceall-btn {
    padding-left: 8px;
    padding-right: 6px !important;
}

/* replace button */
.ty-replace-panel-row #search-panel-replace-btn {
    padding-left: 16px;
    padding-right: 16px;
}

/* sidebar */
.sidebar-menu {
    color: var(--text-color2);
}

/* sidebar shadow */
.typora-node #typora-sidebar {
    box-shadow: 3px 0px 10px rgba(0, 0, 0, .5);
}

/* divider between file item and search */
.ty-sidebar-search-panel {
    border-color: var(--menu-divider-color);
}

/* file item in sidebar */
#file-library .file-list-item {
    border-bottom: 0px;
    opacity: 1;
    border-left: 4px solid;
    border-color: var(--bg-color2);
}

/* file item hover */
#file-library .file-list-item:hover {
    background-color: var(--hover-bg-color1);
    color: var(--hover-text-color);
    border-color: var(--hover-bg-color1);
}

/* file item active */
#file-library .file-list-item.active {
    background-color: var(--hover-bg-color1);
    color: var(--hover-text-color);
    border-color: var(--hover-text-color);
}

/* suffix of file item*/
.file-list-item-file-ext-part {
    opacity: 0.8;
}

/* sidebar file menu */
#sidebar-files-menu {
    border: 0px;
    box-shadow: -2px -2px 10px rgba(0, 0, 0, .5);
}

/* sidebar file menu item */
.dropdown-menu>li>a {
    color: var(--text-color2);
}

.dropdown-menu>li>a:hover {
    color: var(--hover-text-color);
}

/* sidebar file menu close button */
#close-sidebar-menu-btn:hover {
    color: var(--hover-text-color);
}

/* sidebar file nemu divider */
#sidebar-files-menu>.show+.menuitem-group-label.show {
    border-color: var(--menu-divider-color);
}

/* sidebar footer */
.sidebar-footer {
    border: 0px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, .5);
    transition: 0.3s;
    display: flex !important;
}

.pin-outline #typora-sidebar:hover .sidebar-footer:not(.show-sidebar-footer-context) {
    animation: none;
}

/* remove outline when file item in treeview is selected*/
.file-library-node:not(.file-node-root):focus>.file-node-content {
    outline: none;
}

/* sort button on sidebar file menu */
.ty-side-sort-btn.active,
.ty-side-sort-btn:hover {
    color: var(--hover-text-color);
}

/* setting */
/* header in setting */
.window-header {
    box-shadow: 0px 2px 10px rgba(0, 0, 0, .5) !important;
}

/* sidebar in setting */
.sidebar {
    background-color: var(--bg-color2) !important;
    box-shadow: 3px 0px 10px rgba(0, 0, 0, .5);
}

.list-group-content {
    margin-left: 10px !important;
}

/* sidebar button in setting menu */
.nav-group-item {
    color: var(--text-color2) !important;
    border-top-left-radius: 6px !important;
    border-bottom-left-radius: 6px !important;
    border-top-right-radius: 0px !important;
    border-bottom-right-radius: 0px !important;
}

/* sidebar button hover in setting menu */
.nav-group-item:hover,
.nav-group-item:active,
.nav-group-item.active {
    background-color: var(--hover-bg-color1) !important;
    color: var(--hover-text-color) !important;
}

/* remove up and down button from number type input*/
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
}

/* the indent example in setting.editor */
div.pane>div:nth-child(4)>div:nth-child(2) .label-input-group td:last-child div {
    border: 0px !important;
    border-radius: 6px;
    background-color: var(--bg-color5);
    box-shadow: 0px 0px 10px rgba(0, 0, 0, .2);
    margin: 10px !important;
}

/* button in setting menu */
.ty-preferences button.btn-default {
    border: 0px;
    background-color: var(--bg-color5);
    box-shadow: 0px 0px 10px rgba(0, 0, 0, .2);
    border-radius: 6px;
}

/* button hover in setting menu */
.ty-preferences .btn-default:not([disabled]):hover {
    background-color: var(--hover-bg-color1) !important;
}

/* return button in setting menu */
.window-header button:hover {
    color: var(--text-color2) !important;
}

/* search input in setting menu */
.search-input {
    border-top-left-radius: 6px !important;
    border-bottom-left-radius: 6px !important;
    border-top-right-radius: 0px !important;
    border-bottom-right-radius: 0px !important;
    margin-top: 10px !important;
    margin-bottom: 10px !important;
    margin-left: 10px !important;
}

.search-input:focus {
    border: none !important;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, .2) !important;
}

/* select item (mostly in setting menu) */
select {
    border: 0px;
    border-radius: 6px;
    background-color: var(--input-color) !important;
    padding-top: 5px !important;
    padding-bottom: 5px !important;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, .2);
}

/* enabled select item hover */
select:not([disabled]):hover {
    color: var(--text-color2);
    opacity: 1;
}

/* disabled select item hover */
select[disabled]:hover {
    opacity: .5;
}

/* mega menu */
.megamenu-content,
.megamenu-opened header {
    background: var(--bg-color1);
}

.megamenu-content {
    display: block;
    visibility: hidden;
    opacity: 0;
    transition: 0.3s;
}

.megamenu-opened .megamenu-content {
    visibility: visible;
    opacity: 1;
    animation: none;
}

/* mega menu sidebar*/
.megamenu-menu {
    background-color: var(--bg-color2);
    box-shadow: 3px 0px 10px rgba(0, 0, 0, .5);
}

/* return button in mega menu */
#megamenu-menu-sidebar .menu-style-btn {
    border: 0px;
}

/* remove divider in mega menu */
.megamenu-menu-header {
    border-color: var(--menu-divider-color);
}

/* return button color in mega menu */
.megamenu-menu-header #megamenu-menu-header-title {
    color: var(--text-color2);
}

/* return button hover in mega menu */
.megamenu-menu-header:hover {
    background-color: var(--hover-bg-color1);
}

/* return button hover in mega menu */
.megamenu-menu-header:hover #megamenu-menu-header-title {
    color: var(--hover-text-color);
}

/* long button in mega menu */
.long-btn {
    border: 0px;
    background-color: var(--bg-color5);
    color: var(--text-color1);
    box-shadow: 0px 0px 10px rgba(0, 0, 0, .2);
    margin-bottom: 10px;
    margin-left: 10px;
}

/* recent file in mega menu */
#recent-file-panel {
    padding: 10px
}

#recent-document-table {
    box-shadow: 0px 0px 10px rgba(0, 0, 0, .2);
}

#recent-file-panel-action-btn {
    background: var(--bg-color5);
    border: 0px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, .2);
}

#recent-file-panel thead tr {
    background-color: var(--table-thead-color);
}

#recent-file-panel tbody tr:nth-child(2n) {
    background-color: var(--table-bg-darker-color);
}

#recent-file-panel tbody tr:nth-child(2n+1) {
    background-color: var(--table-bg-color);
}

#recent-file-panel-action-btn:hover {
    background-color: var(--hover-bg-color1);
    color: var(--text-color2);
}

/* theme preview */
.theme-preview-div {
    box-shadow: 10px 0px 10px rgba(0, 0, 0, .8);
}

/* theme preview hover */
.theme-preview-div:hover {
    border-color: var(--theme-select-color);
}

/* context menu and spell check panel */
.dropdown-menu:not(.megamenu-menu-list) {
    background-color: var(--bg-color2);
    color: var(--text-color2);
    box-shadow: 0px 0px 10px rgba(0, 0, 0, .5);
}

/* divider in context menu and spell check panel */
.dropdown-menu .divider {
    border-color: var(--menu-divider-color);
}

/* remove divider outline */
.dropdown-menu {
    border: 0px;
}

/* footer */
footer.ty-footer {
    border-top: 0px !important;
    background-color: var(--bg-color2) !important;
    /*     color: var(--text-color2); */
    box-shadow: 0px -2px 10px rgba(0, 0, 0, .5);
}

/* footer item */
.footer-item,
#outline-btn,
#footer-word-count {
    color: var(--text-color2);
    opacity: 1;
}

/* footer item hover */
.footer-item:hover,
#outline-btn:hover {
    background-color: var(--hover-bg-color1);
    color: var(--hover-text-color);
}

/* button on some panel */
.btn {
    border: 0px;
    outline-width: 0px !important;
}

.btn:hover {
    background-color: var(--hover-bg-color1);
    color: var(--hover-text-color);
}

/* traffic button hover */
#top-titlebar .toolbar-icon.btn:hover {
    color: var(--text-color2);
    background-color: var(--hover-bg-color1);
}

/* traffic button hover */
#top-titlebar #w-close:hover {
    background-color: #e81123 !important;
}

/* adjust maxmize restore button height */
.typora-maxmized #w-restore {
    height: 24px
}

/* left upper button hover */
.ty-menu-btn-area:hover .ty-menu-btn-area-sub {
    color: var(--text-color2) !important;
}

/* scrollbar */
::-webkit-scrollbar {
    width: 8px;
    padding-right: 10px;
    background-color: rgba(0, 0, 0, 0);
}

/* scrollbar track */
::-webkit-scrollbar-track:hover {
    background-color: var(--scrollbar-track-color) !important;
    border-radius: 4px;
}

/* scrollbar thumb */
::-webkit-scrollbar-thumb,
::-webkit-scrollbar-thumb:active {
    background-color: var(--scrollbar-thumb-color) !important;
    border-radius: 4px;
}

/* tip when hover on a button */
#ty-tooltip {
    background-color: var(--bg-color4);
    color: var(--text-color4);
}

/* item container hover in context menu */
.menu-item-container:hover {
    background-color: var(--bg-color2);
}

/* item in context menu */
.menu-item-container .menu-style-btn {
    border-color: var(--menu-divider-color);
}

/* mathjax edit panel*/
.md-rawblock-before {
    border-top-left-radius: 6px;
}

.md-rawblock-after {
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

/* mathjax focus */
.MathJax_SVG:focus {
    outline: none;
    background-color: transparent;
}

/* notification panel */
#md-notification {
    background-color: var(--bg-color2) !important;
    color: var(--text-color2);
    box-shadow: 0px 2px 10px rgba(0, 0, 0, .5);
}

#ty-surpress-mode-warning-close-btn {
    float: unset !important;
    margin: 0px !important;
}

.unibody-window #md-notification p {
    bottom: -4px !important;
}

/* inline codeblock */
code {
    font-size: 0.9em;
    background-color: var(--bg-color5);
    border-radius: 6px;
    padding: 4px 4px 4px 4px;
    margin: 0px 6px 0px 6px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, .2);
}

/* codeblock */
.md-fences,
.md-fences:active {
    background-color: var(--bg-color5);
    border-radius: 6px;
    padding: 8px 4px 8px 4px !important;
    margin-top: 15px;
    margin-bottom: 15px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, .2);
}

.md-fences .code-tooltip {
    display: block !important;
    visibility: hidden;
    opacity: 0;
    transition: 0.3s;
    background-color: var(--bg-color3);
}

.md-fences.md-focus .code-tooltip {
    opacity: 1;
    visibility: visible;
}

.CodeMirror-lines {
    padding-left: 4px;
}

/* selected text and cursor */
.CodeMirror-selected,
.CodeMirror-selectedtext {
    background: var(--code-select-bg-color) !important;
}

.CodeMirror div.CodeMirror-cursor {
    border-left: 2px solid var(--code-cursor-color);
    z-index: 3;
}

.CodeMirror.cm-s-typora-default div.CodeMirror-cursor {
    border-left: 3px solid var(--code-cursor-color);
}

/* highlight */
.cm-s-inner .cm-property {
    color: var(--code-blue-color) !important;
}

.cm-s-inner .cm-operator {
    color: var(--code-cyan-color) !important;
}

.cm-s-inner .cm-keyword {
    color: var(--code-purple-color) !important;
}

.cm-s-inner .cm-tag {
    color: var(--code-red-color) !important;
}

.cm-s-inner .cm-attribute {
    color: var(--code-orange-color) !important;
}

.cm-s-inner .cm-string {
    color: var(--code-green-color) !important;
}

.cm-s-inner .cm-comment,
.cm-s-inner.cm-comment {
    /*     color: var(--code-orange-color) !important; */
    color: var(--code-grey-color) !important;
    font-style: italic;
}

.cm-s-inner .cm-header,
.cm-s-inner .cm-def,
.cm-s-inner.cm-header,
.cm-s-inner.cm-def {
    /*     color: var(--code-red-color) !important; */
    color: var(--code-blue-color) !important;
}

.cm-s-inner .cm-meta,
.cm-s-inner .cm-qualifier {
    color: var(--code-red-color) !important;
}

.cm-s-inner .cm-builtin {
    /*     color: var(--code-blue-color) !important; */
    color: var(--code-cyan-color) !important;
}

.cm-s-inner .cm-bracket {
    color: var(--text-color1) !important;
}

.cm-s-inner .cm-number {
    color: var(--code-orange-color) !important;
}

.cm-s-inner .cm-variable {
    color: var(--text-color1) !important;
}

.cm-s-inner .cm-variable-2 {
    /*     color: var(--code-blue-color) !important; */
    color: var(--code-yellow-color) !important;
}

.cm-s-typora-default .cm-header,
.cm-s-typora-default .cm-property {
    color: var(--code-red-color) !important;
}

.cm-s-typora-default .cm-string {
    /*     color: var(--code-blue-color); */
    color: var(--code-purple-color);
}

.cm-s-typora-default .cm-atom {
    color: var(--code-grey-color);
    font-style: italic;
}

.cm-s-typora-default .cm-number {
    color: var(--code-orange-color);
    font-style: normal !important;
}

.cm-s-typora-default .cm-link {
    color: var(--code-blue-color);
}

.cm-s-typora-default .CodeMirror-activeline-background {
    background: var(--hover-bg-color1);
}

.cm-s-typora-default .cm-comment,
.cm-s-typora-default .cm-code {
    color: var(--code-purple-color);
}

.cm-s-typora-default .cm-tag {
    /*     color: var(--code-red-color); */
    color: var(--code-blue-color);
}

.cm-s-typora-default .cm-strong,
.cm-s-typora-default .cm-em,
.cm-s-typora-default .cm-del {
    /*     color: var(--code-green-color); */
    color: var(--code-orange-color)
}

.cm-s-typora-default .cm-block-start.cm-variable-2 {
    /*     color: var(--code-orange-color); */
    color: var(--code-red-color);
}

.cm-formatting-task .cm-formatting-task {
    color: var(--code-red-color);
}

/* math formula tag */
.cm-s-inner .cm-atom,
.cm-s-inner.cm-atom {
    color: var(--code-blue-color);
}

/* inline codeblock in source mode */
.cm-s-typora-default .cm-comment {
    color: var(--code-green-color);
}

/* horizontal divider when language is markdown */
.cm-s-inner .cm-hr {
    color: var(--text-color1);
}

/* variable type when language is c/cpp */
.cm-s-inner .cm-variable-3 {
    color: var(--code-purple-color);
}

/* unknown highlight keyword */
.cm-s-inner .cm-quote,
.cm-s-inner.cm-quote {
    color: #57ac57;
}

.cm-s-inner .cm-link {
    color: var(--code-blue-color);
}

.cm-s-inner .cm-negative {
    color: #d95050;
}

.cm-s-inner .cm-positive {
    color: #50e650;
}

.cm-s-inner .cm-string-2 {
    color: #f50;
}

.CodeMirror-gutters {
    border-right: none;
}

/* focus mode */
.on-focus-mode .md-end-block:not(.md-focus) .md-toc-item {
    opacity: 0.5;
}

.on-focus-mode #write h1:not(.md-focus):before {
    opacity: 0.5;
}

.on-focus-mode #write h2:not(.md-focus):before {
    opacity: 0.5;
}

.on-focus-mode #write h1:not(.md-focus) {
    border-color: var(--text-color5);
}

.on-focus-mode #write h2:not(.md-focus) {
    border-color: var(--text-color5);
}

.on-focus-mode #write h3:not(.md-focus) {
    border-color: var(--text-color5);
}

/* YAML block */
pre.md-meta-block,
pre.md-meta-block:active {
    background-color: var(--bg-color5);
    box-shadow: 0px 0px 10px rgba(0, 0, 0, .2);
    border-radius: 6px;
    padding: 10px;
    padding-left: 20px;
    padding-right: 20px;
}


/* switch between different mode */
#typora-source {
    display: block !important;
    visibility: hidden;
    opacity: 0;
    transition: 0.3s;
}

.typora-sourceview-on #typora-source {
    visibility: visible;
    opacity: 1;
}

#typora-source .CodeMirror-lines {
    max-width: 1200px;
    padding-left: 70px;
    padding-right: 70px;
}

#write {
    display: block !important;
    visibility: hidden;
    opacity: 0;
    transition: 0.3s;
    max-width: 1200px;
    padding-left: 70px;
    padding-right: 70px;
}

:not(.typora-sourceview-on) #write {
    visibility: visible;
    opacity: 1;
}

/* #md-searchpanel {
    visibility: hidden;
    opacity: 0;
    transition: 0.3s !important;
}

.on-search-panel-open #md-searchpanel {
    visibility: visible;
    opacity: 1;
} */

.uni-preference-panel {
    display: block;
    visibility: hidden;
    opacity: 0;
    transition: 0.3s;
}

.show-preference-panel .uni-preference-panel {
    visibility: visible;
    opacity: 1;
}


/* quick open menu */
.typora-quick-open-item:hover {
    background-color: var(--hover-bg-color1);
    color: var(--hover-text-color);
}


/* insert table panel */
.modal-content {
    border: 0px;
    border-radius: 6px;
}

.modal-content .btn-primary {
    background-color: var(--hover-bg-color1);
    color: var(--text-color1);
    outline-width: 0px;
}

.modal-content .btn-primary:hover {
    color: var(--hover-text-color);
}

.modal-content .form-control,
.modal-content .form-control:focus {
    box-shadow: 0px 0px 10px rgba(0, 0, 0, .2);
}

.modal-backdrop {
    background-color: black;
    opacity: 0.3 !important;
}

/* zoom  */
#zoom-hint #zoom-hint-reset {
    color: var(--text-color1)
}

#zoom-hint .zoom-hint-button:hover {
    color: var(--hover-text-color) !important;
}

/* word count */
#footer-word-count-info {
    display: block;
    visibility: hidden;
    opacity: 0;
    transition: 0.3s;
}

.ty-show-word-count #footer-word-count-info {
    visibility: visible;
    opacity: 1;
}

/* spell check */
#spell-check-panel {
    display: block;
    visibility: hidden;
    opacity: 0;
    transition: 0.3s;
}

.ty-show-spell-check #spell-check-panel {
    visibility: visible;
    opacity: 1;
}

/* search result */
.md-search-select {
    border: 2px solid rgb(69, 125, 255);
    box-sizing: content-box;
    color: var(--text-color1) !important;
}

.md-search-hit {
    background-color: var(--search-select-bg-color);
}

/* search panel message */
#searchpanel-msg {
    background-color: var(--bg-color2);
    color: var(--text-color2);
}

.searchpanel-msg-btn:hover {
    background-color: var(--hover-bg-color1);
    color: var(--hover-text-color);
}

/* language selection for codeblock */
.auto-suggest-container {
    border: 0px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, .2);
    background-color: var(--bg-color2);
}


/* sidebar outline item hover and active */
.outline-item:hover {
    color: var(--hover-text-color);
}

.outline-label:hover {
    text-decoration: none;
}

.pin-outline .outline-active {
    color: var(--hover-text-color);
}

/* sidebar title hover */
.info-panel-tab:hover {
    color: var(--hover-text-color) !important;
}

/* active file in sidebar file menu treeview */
.file-tree-node.active>.file-node-background {
    background-color: var(--hover-bg-color1);
}

/* hover file in sidebar file menu treeview */
.file-node-content:hover {
    cursor: pointer;
}

/* saved button in megamenu */
#m-saved:hover {
    background-color: var(--bg-color2);
    color: var(--text-color2);
    cursor: default;
}

/* mermaid sequence*/
text.actor {
    fill: var(--text-color1);
}

.labelText {
    fill: var(--text-color1);
}

.loopText {
    fill: var(--text-color1);
}

/* mermaid flowchart */
.node rect,
.node circle,
.node ellipse,
.node polygon {
    fill: var(--bg-color2);
    stroke: var(--text-color1);
    stroke: var(--menu-divider-color);
}

.edgePath .path {
    stroke: var(--menu-divider-color);
}

.label {
    color: var(--text-color1);
}

/* mermaid gantt */
.titleText {
    fill: var(--text-color1);
}

.section0,
.section2 {
    fill: var(--table-thread-color);
}

.section1,
.section3 {
    fill: var(--table-bg-color);
}

.task0,
.task1,
.task2,
.task3 {
    fill: rgb(80, 84, 90);
    stroke: rgb(80, 84, 90);
}

.taskText0,
.taskText1,
.taskText2,
.taskText3 {
    fill: var(--text-color2) !important;
}

.active0,
.active1,
.active2,
.active3 {
    fill: rgb(100, 104, 110);
    stroke: rgb(100, 104, 110);
}

.activeText0,
.activeText1,
.activeText2,
.activeText3 {
    fill: var(--text-color2) !important;
}

.done0,
.done1,
.done2,
.done3 {
    fill: rgb(48, 51, 58);
    stroke: rgb(48, 51, 58);
}

.crit0,
.crit1,
.crit2,
.crit3 {
    fill: rgb(150, 150, 150);
    stroke: var(--text-color1);
}

.activeCrit0,
.activeCrit1,
.activeCrit2,
.activeCrit3 {
    fill: rgb(100, 104, 110);
    stroke: var(--text-color1);
}

.doneCrit0,
.doneCrit1,
.doneCrit2,
.doneCrit3 {
    fill: rgb(48, 51, 58);
    stroke: var(--text-color1);
}

.taskTextOutside0,
.taskTextOutside2,
.taskTextOutside1,
.taskTextOutside3 {
    fill: var(--text-color1) !important;
}

.grid text {
    fill: white;
}

.today {
    stroke: var(--text-color1)
}

/* flow diagram */
.md-fences[lang=flow] .md-diagram-panel-preview rect {
    fill: var(--bg-color2);
    stroke: var(--menu-divider-color);
    stroke-width: 1.2;
}

.md-fences[lang=flow] .md-diagram-panel-preview path {
    stroke: var(--menu-divider-color);
    stroke-width: 1.2;
}

.md-fences[lang=flow] #cond {
    fill: var(--bg-color2);
}

/* sequence diagram */
.md-fences[lang=sequence] .md-diagram-panel-preview rect:not([fill=none]) {
    fill: var(--bg-color2);
    stroke: var(--menu-divider-color);
    stroke-width: 1.2;
}

.md-fences[lang=sequence] .md-diagram-panel-preview path {
    fill: var(--menu-divider-color);
    stroke: var(--menu-divider-color);
    stroke-width: 1.2;
}

.md-fences[lang=sequence] text,
.md-fences[lang=flow] text {
    font-family: 'Consolas' !important;
}

/* remove box shadow when not edit graph */
.md-fences[lang=sequence]:not(.md-focus),
.md-fences[lang=mermaid]:not(.md-focus),
.md-fences[lang=flow]:not(.md-focus) {
    box-shadow: none;
}

/* remove border when edit graph */
.md-diagram-panel {
    border: none !important;
}